<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head><title>Struts 2 Training Materials</title>
</head>

<body>
<c:set var="root" value="${pageContext.request.contextPath}"/>
<div align="center">
    <center>
        <table border="1" cellspacing="1" width="400">
            <tr>
                <td width="390"><font size="4"><b>Struts 2 Action </b></font></td>
            </tr>
            <tr>
                <td width="384">
                    <ul>
                        <li>
                            <a href="#"> What are Struts 2 Actions ??</a>
                            <br>
                            - All the action classes we define can extend from com.opensymphony.xwork2.ActionSupport class and override the execute() method.
                            <br>
                            - OR just implement execute() method and struts will use reflection to find the correct method to execute.
                            <br>
                            - In the struts.xml, configure the action class with action tag and class attribute.
                            Define which result page should return to the user with result tag and the name of the action you can use to access this action class with name attribute.
                            <br>
                            - To validate the user inputs you can override the validate() method.
                            <br>
                            - If you are not extending from ActionSupport you can implement Action, Validateable,ValidationAware interfaces.
                        </li>
                        <li>
                            <a href="#"> What are Struts Action Forms ?? - Model Driven / Object Backed</a>
                            <br>
                            - has eliminated the form beans.
                            <br>
                            - If an Action implements the “ModelDriven” interface, it gains the extra ability to transfer the form data into the object automatically.
                            <br>
                            - Implementation of getModel() method will help struts to find the model object you return and bind the user parameters using the getter
                            setter methods. Also we have to initialize the model for struts.
                            <br>
                            - Object Backed - we just need to define the model and struts will create the new object for us. Need to have the
                            getter and the setter.
                            <br>
                            - When you use object backed design we have to tell the bean name and the property name in your property name.
                            <br>
                            - ex : - s:textfield name="user.userID" label="User Name"
                            <br>
                            - But when you use model driven you can directly specify the property name of the bean variable.
                            <br>
                            - ex: - s:textfield name="userID" label="User Name"
                        </li>
                        <li>
                            <a href="#"> Configure Message Resources</a>
                            <br>
                            To use resource bundle to retrieve the message from properties file, you have to understand the Struts 2 resource bundle search order :
                            <br> <img src="../../images/struts2-resource-bundle.jpg" border="0"/>
                            <br>
                        </li>
                    </ul>
                </td>
            </tr>
             <tr>
                <td>
                    <a href="${root}/index.jsp">HOME</a>
                </td>
            </tr>
        </table>
    </center>
</div>
</body>
</html>